﻿@model BizMate.WebUI.ViewModel.JournalViewModel

@{
    ViewBag.Title = "Journal Entry";
}

<script type="text/javascript">

    $(document).ready(function () {
        $("table tr:even").addClass("evenrow");

    });

</script>

<h2>Journal Entry</h2>

@using(Html.BeginForm()){
    
@Html.ValidationSummary(false)    

<table>
    <tr>
        <td>@Html.LabelFor(model => model.VoucherNo, "Voucher No")</td>
        <td>@Html.TextBoxFor(model => model.VoucherNo)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(model => model.VoucherDate, "Date")</td>
        <td>@Html.TextBox("VoucherDate", DateTime.Now.ToString("dd-MMM-yyy"))</td>

        <td>@Html.LabelFor(model => model.UnitId, "Unit")</td>
        <td>@Html.DropDownListFor(model => model.UnitId, ViewBag.Unit as SelectList)</td>
    </tr>

    <tr>
        <td>@Html.DropDownListFor(model => model.JounalDetailsList[0].Type, ViewBag.Type1 as SelectList)</td>

        <td>@Html.LabelFor(model=>model.JounalDetailsList[0].AccountId, "Account")</td>
        <td>@Html.DropDownListFor(model => model.JounalDetailsList[0].AccountId, ViewBag.Account as SelectList)</td>

        <td>@Html.LabelFor(model => model.JounalDetailsList[0].Amount)</td>
        <td>@Html.TextBoxFor(model => model.JounalDetailsList[0].Amount)</td>
    </tr>

    <tr><td></td></tr>

    <tr>
        <td>@Html.DropDownListFor(model => model.JounalDetailsList[1].Type, ViewBag.Type2 as SelectList)</td>

        <td>@Html.LabelFor(model => model.JounalDetailsList[1].AccountId, "Account")</td>
        <td>@Html.DropDownListFor(model => model.JounalDetailsList[1].AccountId, ViewBag.Account as SelectList)</td>

        <td>@Html.LabelFor(model=>model.JounalDetailsList[1].Amount)</td>
        <td>@Html.TextBoxFor(model => model.JounalDetailsList[1].Amount, new { @readonly=true })</td>
    </tr>

    <tr>
        <td>@Html.LabelFor(model => model.Narration)</td>
        <td>@Html.TextAreaFor(model => model.Narration)</td>

        <td></td>
        <td></td>
        <td><input type="submit" value="Save" /></td>
    </tr>

</table>
}